package com.example.demo.BuilderPattern;

import java.util.ArrayList;
import java.util.List;

/**
 * 场景类
 */
public class Client {

    public static void main(String[] args) {
//        CarModel benzModel = new BenzModel();
        ArrayList<String> list = new ArrayList<>();
        list.add("start");
        list.add("alarm");
//        benzModel.setSequence(list);
//        benzModel.run();

//        BenzBuilder benzBuilder = new BenzBuilder();
//        benzBuilder.setSequence(list);
//        benzBuilder.getCarModel().run();
//        ArrayList<String> list1 = new ArrayList<>();
//        list1.add("alarm");
//        list1.add("start");
//        BMWBuilder bmwBuilder = new BMWBuilder();
//        bmwBuilder.setSequence(list1);
//        bmwBuilder.getCarModel().run();

        Director director = new Director();
        //1万辆A类型的奔驰车
        for(int i=0;i<10000;i++){
            director.getABenzModel().run();
        }
        //100万辆B类型的奔驰车
        for(int i=0;i<1000000;i++){
            director.getBBenzModel().run();
        }
    }
}
